<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:84:"/www/wwwroot/km/HM-faka-master/public/../application/admin/view/dashboard/index.html";i:1666941281;s:73:"/www/wwwroot/km/HM-faka-master/application/admin/view/layout/default.html";i:1666941281;s:70:"/www/wwwroot/km/HM-faka-master/application/admin/view/common/meta.html";i:1666941281;s:72:"/www/wwwroot/km/HM-faka-master/application/admin/view/common/script.html";i:1666941281;}*/ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
<title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="renderer" content="webkit">
<meta name="referrer" content="never">
<meta name="robots" content="noindex, nofollow">

<link rel="shortcut icon" href="<?php echo $site['ico']; ?>" />
<!-- Loading Bootstrap -->
<link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">

<?php if(\think\Config::get('fastadmin.adminskin')): ?>
<link href="/assets/css/skins/<?php echo \think\Config::get('fastadmin.adminskin'); ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
<?php endif; ?>

<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
  <script src="/assets/js/html5shiv.js"></script>
  <script src="/assets/js/respond.min.js"></script>
<![endif]-->
<script type="text/javascript">
    var require = {
        config:  <?php echo json_encode($config); ?>
    };
</script>

    </head>

    <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
        <div id="main" role="main">
            <div class="tab-content tab-addtabs">
                <div id="content">
                    <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                            <section class="content-header hide">
                                <h1>
                                    <?php echo __('Dashboard'); ?>
                                    <small><?php echo __('Control panel'); ?></small>
                                </h1>
                            </section>
                            <?php if(!IS_DIALOG && !\think\Config::get('fastadmin.multiplenav') && \think\Config::get('fastadmin.breadcrumb')): ?>
                            <!-- RIBBON -->
                            <div id="ribbon">
                                <ol class="breadcrumb pull-left">
                                    <?php if($auth->check('dashboard')): ?>
                                    <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
                                    <?php endif; ?>
                                </ol>
                                <ol class="breadcrumb pull-right">
                                    <?php foreach($breadcrumb as $vo): ?>
                                    <li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
                                    <?php endforeach; ?>
                                </ol>
                            </div>
                            <!-- END RIBBON -->
                            <?php endif; ?>
                            <div class="content">
                                <!--<link href="/assets/css/dashboard.css" rel="stylesheet" />-->
<?php echo doAction('admin_dashboard_head'); ?>
<style>
    .row-advert p{
        margin-bottom: 0;
    }
</style>

<div class="panel-default panel-intro">
    <?php echo doAction('admin_dashboard_upgrade'); ?>


    <div class="alert" role="alert" style="background: #4e73df; color: #fff; font-weight: bold;">
        <div class="flex items-center set-a" style="display: inline-block;">
            <span id="init-version">
                系统版本 v<span id="version"><?php echo $options['version']; ?></span>

                <a href="javascript:;" id="check-update">检测更新</a>
            </span>
        </div>
        <span style="width: 100px; float: right;"><a href="http://hmbbs.buzz/forum.php?mod=forumdisplay&fid=2" target="_blank">更新记录 →</a></span>
    </div>

    <div class="row" style="margin-top:15px;" id="statistics">

        <div class="col-lg-12">
        </div>
        <div class="col-xs-6 col-md-3">
            <div class="panel bg-blue-gradient no-border">
                <div class="panel-body">
                    <div class="panel-content">
                        <div class="row">
                            <div class="col-md-6">
                                <h1 class="no-margins"><?php echo $user_total; ?></h1>
                                <div class="font-bold"><i class="fa fa-magic"></i>
                                    <small>用户总数</small>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <h1 class="no-margins"><?php echo $today_register; ?></h1>
                                <div class="font-bold"><i class="fa fa-magic"></i>
                                    <small>今日注册</small>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-6 col-md-3">
            <div class="panel bg-teal-gradient no-border">
                <div class="panel-body">
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-md-6">
                                <h1 class="no-margins"><?php echo $category_total; ?></h1>
                                <div class="font-bold"><i class="fa fa-database"></i>
                                    <small>分类数量</small>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <h1 class="no-margins"><?php echo $goods_total; ?></h1>
                                <div class="font-bold"><i class="fa fa-filter"></i>
                                    <small>商品数量</small>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-xs-6 col-md-3">
            <div class="panel bg-purple-gradient no-border">
                <div class="panel-body">
                    <div class="ibox-content">

                        <div class="row">
                            <div class="col-md-6">
                                <h1 class="no-margins"><?php echo $today_order; ?></h1>
                                <div class="font-bold"><i class="fa fa-files-o"></i>
                                    <small>今日订单</small>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <h1 class="no-margins"><?php echo $today_wait_order; ?></h1>
                                <div class="font-bold"><i class="fa fa-filter"></i>
                                    <small>待处理订单</small>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-6 col-md-3">
            <div class="panel bg-green-gradient no-border">
                <div class="panel-body">
                    <div class="ibox-content">

                        <div class="row">
                            <div class="col-md-6">
                                <h1 class="no-margins"><?php echo $today_order_money; ?></h1>
                                <div class="font-bold"><i class="fa fa-picture-o"></i>
                                    <small>今日成交金额</small>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <h1 class="no-margins"><?php echo $today_order_profit; ?></h1>
                                <div class="font-bold"><i class="fa fa-filter"></i>
                                    <small>今日利润</small>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <div class="row row-advert" id="poster-box" data-exists="<?php echo $poster ? 'true' : 'false'; ?>">
        <div class="col-xs-12 col-md-6">
            <table class="table table-striped table-bordered" style="background: #fff;">
                <thead>
                    <tr>
                        <th class="px-3 py-3">联盟推广<a href="<?php echo $poster ? $poster['poster_url'] : 'javascript:;'; ?>" id="poster_url" target="_blank" style="float: right;">我要推广</a></th>
                    </tr>
                </thead>
                <tbody class="" id="poster-list">
                    <?php if($poster): if(is_array($poster['poster']) || $poster['poster'] instanceof \think\Collection || $poster['poster'] instanceof \think\Paginator): $i = 0; $__LIST__ = $poster['poster'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                    <tr>
                        <td class="px-4 py-2">
                            <a href="<?php echo $vo['url']; ?>" target="_blank">
                                <?php echo $vo['content']; ?>
                            </a>
                        </td>
                    </tr>
                    <?php endforeach; endif; else: echo "" ;endif; endif; ?>
                </tbody>
            </table>
        </div>
        <div class="col-xs-12 col-md-6">
            <table class="table table-striped table-bordered" style="background: #fff;">
                    <thead>
                        <tr>
                            <th class="px-3 py-3">官方公告<a href="https://blog.ysxue.net/" target="_blank" style="float: right;">官方网站</a></th>
                        </tr>
                    </thead>
                    <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800" id="notice-list">
                        <?php if($poster): if(is_array($poster['notice']) || $poster['notice'] instanceof \think\Collection || $poster['notice'] instanceof \think\Paginator): $i = 0; $__LIST__ = $poster['notice'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                        <tr class="text-gray-700 dark:text-gray-400">
                            <td class="px-4 py-2">
                                <a href="<?php echo $vo['url']; ?>" target="_blank">
                                    <?php echo $vo['content']; ?>
                                </a>
                            </td>
                        </tr>
                        <?php endforeach; endif; else: echo "" ;endif; endif; ?>
                    </tbody>
                </table>
        </div>
    </div>


    <div class="row " style="margin-bottom: 20px;">
        <div style="display: none;">
            <textarea id="sts-order-date"><?php echo json_encode($sts_order['date']); ?></textarea>
            <textarea id="sts-order-order-count"><?php echo json_encode($sts_order['order_count']); ?></textarea>
            <textarea id="sts-order-sales-money"><?php echo json_encode($sts_order['sales_money']); ?></textarea>
        </div>
        <div class="col-md-12">
            <div id="lineChart" style="width: 100%;height:400px; background: #fff; padding: 10px;"></div>
        </div>

    </div>


    <div class="row">
        <div class="col-xs-12 col-md-6">
            <table class="table table-striped table-bordered" style="background: #fff;">
                <thead>
                    <tr>
                        <th class="px-4 py-3">商品销量Top10</th>
                        <th class="px-4 py-3">商品名称</th>
                        <th class="px-4 py-3">销售额</th>
                        <th class="px-4 py-3">销量</th>
                    </tr>
                </thead>
                <tbody>
                    <?php if(is_array($goods_list) || $goods_list instanceof \think\Collection || $goods_list instanceof \think\Paginator): $key = 0; $__LIST__ = $goods_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($key % 2 );++$key;?>
                    <tr class="text-gray-700 dark:text-gray-400">
                        <td class="px-4 py-2"><?php echo $key; ?></td>
                        <td class="px-4 py-2"><?php echo substrCn($vo['name'], 28); ?></td>
                        <td class="px-4 py-2">&yen; <?php echo $vo['sales_money']; ?></td>
                        <td class="px-4 py-2"><?php echo $vo['sales']; ?></td>
                    </tr>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </tbody>
            </table>
        </div>
        <div class="col-xs-12 col-md-6">
            <table class="table table-striped table-bordered" style="background: #fff;">
                <thead>
                    <tr>
                        <th class="px-4 py-3">用户消费Top10 (不统计游客)</th>
                        <th class="px-4 py-3">用户账号</th>
                        <th class="px-4 py-3">订单数量</th>
                        <th class="px-4 py-3">消费金额</th>
                    </tr>
                </thead>
                <tbody>
                    <?php if(is_array($user_list) || $user_list instanceof \think\Collection || $user_list instanceof \think\Paginator): $key = 0; $__LIST__ = $user_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($key % 2 );++$key;?>
                    <tr class="text-gray-700 dark:text-gray-400">
                        <td class="px-4 py-2"><?php echo $key; ?></td>
                        <td class="px-4 py-2"><?php echo $vo['nickname']; ?></td>
                        <td class="px-4 py-2"><?php echo $vo['order_count']; ?></td>
                        <td class="px-4 py-2">&yen; <?php echo $vo['consume']; ?></td>
                    </tr>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </tbody>
            </table>
        </div>
    </div>

</div>
<span id="upgrade" data-upgrade="<?php echo isset($upgrade['version']) ? $upgrade['version'] : 0; ?>"></span>
<textarea style="display: none;" id="upgrade-content"><?php echo empty($upgrade['content']) ? '' : $upgrade['content']; ?></textarea>
<script id="upgrade_tpl" type="text/html">
    <div>
        <form class="form-horizontal">
            <fieldset style="text-align: center;" id="upgrade-text">
                <p style="color: #f75444; font-weight: bold; font-size: 15px;">发现新版本，老版本即刻起停止维护，建议您立即更新！</p>
                <p style="color: #f75444; font-weight: bold; font-size: 15px;">更新前请先备份网站文件及数据库，避免更新异常导致网站无法访问！</p>
                <p style="color: #f75444; font-weight: bold; font-size: 15px;">如更新过程出现任何问题，请及时联系官方人员获取免费协助！</p>
                <%=#upgrade_content%>
            </fieldset>
        </form>
    </div>
</script>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
    </body>
</html>
